Skip to content

agentHost: adopt AHP protocol updates (PR 188)#320004

Merged
connor4312 merged 1 commit into
mainfrom
connor4312/ahp-pr188
Jun 4, 2026
Merged

agentHost: adopt AHP protocol updates (PR 188)#320004
connor4312 merged 1 commit into
mainfrom
connor4312/ahp-pr188

Conversation

@connor4312
Copy link
Copy Markdown
Member

Syncs the agent-host-protocol types to upstream 740f6cf and adopts the breaking changes from PR 188, while skipping PR 191 (Changeset/ChangesSummary rename), which we're not ready to adopt yet.

  • Replaces toolClientId on tool-call actions with contributor: { kind, clientId } so the renderer/server can distinguish client- vs MCP-provided tools.
  • Plumbs the new ChangesetOperationStatus field through the commit-operation provider, tests, and reducer fixtures.
  • Adds the required enabled/state fields to McpServerCustomization stubs across tests and pluginParsers.
  • Narrows ISyncedCustomization.customization and related helpers to PluginCustomization so per-plugin children/load access is type-safe.
  • Re-applies a local divergence in Snapshot.state to keep ResourceWatchState in the union (still produced by the local agent host on subscribe), with a post-sync patch in scripts/sync-agent-host-protocol.ts so future re-syncs preserve it.

Copilot AI review requested due to automatic review settings June 4, 2026 20:43
@connor4312 connor4312 enabled auto-merge June 4, 2026 20:44
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates VS Code’s agent host integration to match upstream agent-host-protocol commit 740f6cf (PR 188), adopting the protocol’s breaking changes around tool-call attribution, MCP server lifecycle state, and changeset operation status, while keeping a local protocol divergence for ResourceWatchState.

Changes:

  • Replace toolClientId with contributor: { kind, clientId | customizationId } for tool calls, and update host/renderer logic + tests accordingly.
  • Add MCP server enabled + state fields across protocol types, reducers, parsers, and test stubs; introduce SessionMcpServerStateChanged.
  • Add ChangesetOperationStatus and plumb operation status handling through changeset reducers/providers and fixtures.
Show a summary per file
File Description
src/vs/workbench/contrib/chat/test/common/plugins/convertBareEnvVarsToVsCodeSyntax.test.ts Updates MCP server customization stubs with required enabled/state.
src/vs/workbench/contrib/chat/test/browser/agentSessions/agentHostClientTools.test.ts Migrates test fixtures from toolClientId to contributor.
src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostSessionHandler.ts Uses contributor to distinguish client vs server tool calls.
src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentCustomizationItemProvider.ts Filters out bare MCP server customizations from plugin-item view.
src/vs/sessions/contrib/providers/agentHost/test/browser/localAgentHostSessionsProvider.test.ts Narrows customization type in test setup for new union shape.
src/vs/platform/agentPlugins/test/common/pluginParsers.test.ts Updates MCP server customization stubs with enabled/state.
src/vs/platform/agentPlugins/common/pluginParsers.ts Ensures generated MCP server customizations include enabled/state.
src/vs/platform/agentHost/test/node/reducers.test.ts Updates reducer fixtures for new ChangesetOperationStatus.
src/vs/platform/agentHost/test/node/protocolServerHandler.test.ts Updates tool-call fixtures to contributor.
src/vs/platform/agentHost/test/node/mockAgent.ts Emits tool calls using contributor and adapts helper plumbing.
src/vs/platform/agentHost/test/node/copilotPluginConverters.test.ts Updates MCP server customization stubs with enabled/state.
src/vs/platform/agentHost/test/node/copilotAgentSession.test.ts Updates assertions to validate contributor instead of toolClientId.
src/vs/platform/agentHost/test/node/copilotAgent.test.ts Narrows customization types to PluginCustomization and adapts child access.
src/vs/platform/agentHost/test/node/claudeAgent.test.ts Narrows customization progress typing to PluginCustomization.
src/vs/platform/agentHost/test/node/agentSideEffects.test.ts Updates tool-call fixtures and customization progress typing for protocol changes.
src/vs/platform/agentHost/test/node/agentPluginManager.test.ts Adjusts progress typing and assertions for narrowed customization types.
src/vs/platform/agentHost/test/node/agentHostChangesetOperationContributionService.test.ts Updates operation fixtures to include status.
src/vs/platform/agentHost/node/protocolServerHandler.ts Migrates client-tool-call detection to contributor semantics.
src/vs/platform/agentHost/node/copilot/copilotAgentSession.ts Produces contributor metadata for client-provided tools.
src/vs/platform/agentHost/node/copilot/copilotAgent.ts Narrows synced customizations to PluginCustomization and keeps enablement type-safe.
src/vs/platform/agentHost/node/claude/customizations/claudeSessionClientCustomizationsModel.ts Updates customization snapshot comparison logic for new types.
src/vs/platform/agentHost/node/claude/customizations/claudeSdkCustomizationBundler.ts Narrows bundle result to PluginCustomization.
src/vs/platform/agentHost/node/agentPluginManager.ts Narrows progress/status types to PluginCustomization.
src/vs/platform/agentHost/node/agentHostSkillCompletionProvider.ts Skips bare MCP servers and extracts skills without relying on .children on all variants.
src/vs/platform/agentHost/node/agentHostCommitOperationProvider.ts Adds default ChangesetOperationStatus.Idle to commit operation contribution.
src/vs/platform/agentHost/common/state/sessionState.ts Re-exports newly added protocol enums (tool contributors, operation status).
src/vs/platform/agentHost/common/state/protocol/version/registry.ts Registers protocol introduction versions for new actions.
src/vs/platform/agentHost/common/state/protocol/common/commands.ts Adds ClientCapabilities to initialize params.
src/vs/platform/agentHost/common/state/protocol/common/actions.ts Adds new action types and unions (MCP server state + changeset op status).
src/vs/platform/agentHost/common/state/protocol/channels-session/state.ts Introduces MCP server lifecycle state types and tool-call contributor union.
src/vs/platform/agentHost/common/state/protocol/channels-session/reducer.ts Updates reducer for contributor and adds SessionMcpServerStateChanged handling.
src/vs/platform/agentHost/common/state/protocol/channels-session/actions.ts Defines SessionMcpServerStateChanged and updates tool-call start payload.
src/vs/platform/agentHost/common/state/protocol/channels-root/state.ts Documents/permits top-level MCP server customizations in agent info.
src/vs/platform/agentHost/common/state/protocol/channels-changeset/state.ts Adds ChangesetOperationStatus and required status field on operations.
src/vs/platform/agentHost/common/state/protocol/channels-changeset/reducer.ts Handles ChangesetOperationStatusChanged and clears stale errors.
src/vs/platform/agentHost/common/state/protocol/channels-changeset/actions.ts Adds ChangesetOperationStatusChanged action.
src/vs/platform/agentHost/common/state/protocol/action-origin.generated.ts Regenerates action origin unions/dispatchability for new actions.
src/vs/platform/agentHost/common/state/protocol/.ahp-version Updates synced upstream protocol commit marker.
src/vs/platform/agentHost/common/customAgents.ts Skips top-level MCP server customizations when computing selectable agents.
src/vs/platform/agentHost/common/agentPluginManager.ts Narrows ISyncedCustomization.customization and progress callback types.
src/vs/platform/agentHost/common/agentHostCustomizationConfig.ts Narrows container conversion helper to return PluginCustomization.
scripts/sync-agent-host-protocol.ts Applies local protocol divergence post-sync (and now runs patch hook during sync).

Copilot's findings

  • Files reviewed: 42/42 changed files
  • Comments generated: 2

Comment thread scripts/sync-agent-host-protocol.ts Outdated
Syncs the agent-host-protocol types to upstream 740f6cf and adopts the breaking changes from PR 188, while reverting PR 191 (Changeset/ChangesSummary rename) which we are not ready to adopt yet.

- Replaces `toolClientId` on tool-call actions with `contributor: { kind, clientId }` so the renderer/server can distinguish client vs MCP-provided tools

- Plumbs the new `ChangesetOperationStatus` field through commit-operation provider, tests, and reducer fixtures

- Adds the required `enabled`/`state` fields to McpServerCustomization stubs across tests and pluginParsers

- Narrows `ISyncedCustomization.customization` and related helpers to `PluginCustomization` so per-plugin `children`/`load` access is type-safe

- Reverts PR 191 changes in the synced protocol files: keeps `ChangesetSummary` (with `additions`/`deletions`/`files`) and drops `ChangesSummary` from `SessionSummary`

(Commit message generated by Copilot)
@connor4312 connor4312 force-pushed the connor4312/ahp-pr188 branch from b703937 to cdfa5a2 Compare June 4, 2026 20:55
@connor4312 connor4312 merged commit 86f4da4 into main Jun 4, 2026
39 of 40 checks passed
@connor4312 connor4312 deleted the connor4312/ahp-pr188 branch June 4, 2026 21:36
@vs-code-engineering vs-code-engineering Bot added this to the 1.124.0 milestone Jun 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants